package com.smartboot.plus.features.metric;


import com.smartboot.plus.enums.MqttMetricEnum;

import java.util.Arrays;
import java.util.List;

public class ClientMetrics {

    private String current;
    private List<String> x;
    private List<Double> y;
    private String name;  // Store the name of the constant

    // Constructor
    public ClientMetrics(String current, List<String> x, List<Double> y, String name) {
        this.current = current;
        this.x = x;
        this.y = y;
        this.name = name;
    }

    // Getter for current
    public String getCurrent() {
        return current;
    }

    // Setter for current
    public void setCurrent(String current) {
        this.current = current;
    }

    // Getter for x
    public List<String> getX() {
        return x;
    }

    // Setter for x
    public void setX(List<String> x) {
        this.x = x;
    }

    // Getter for y
    public List<Double> getY() {
        return y;
    }

    // Setter for y
    public void setY(List<Double> y) {
        this.y = y;
    }

    // Getter for name
    public String getName() {
        return name;
    }

    // To String method (for debugging or printing the object)
    @Override
    public String toString() {
        return "ClientMetrics{" +
               "name='" + name + '\'' +
               ", current='" + current + '\'' +
               ", x=" + x +
               ", y=" + y +
               '}';
    }

    // Static inner class to hold constants for different metrics
    public static class Metrics {
		public static final ClientMetrics CLIENT_ONLINE = new ClientMetrics("client_online", Arrays.asList(), Arrays.asList(), MqttMetricEnum.CLIENT_ONLINE.name());
		public static final ClientMetrics CLIENT_CONNECT = new ClientMetrics("client_connect", Arrays.asList(), Arrays.asList(), MqttMetricEnum.CLIENT_CONNECT.name());
		public static final ClientMetrics CLIENT_DISCONNECT = new ClientMetrics("client_disconnected", Arrays.asList(), Arrays.asList(), MqttMetricEnum.CLIENT_DISCONNECT.name());
		public static final ClientMetrics CLIENT_SUBSCRIBE = new ClientMetrics("client_subscribe", Arrays.asList(), Arrays.asList(), MqttMetricEnum.CLIENT_SUBSCRIBE.name());
		public static final ClientMetrics CLIENT_UNSUBSCRIBE = new ClientMetrics("client_unsubscribe", Arrays.asList(), Arrays.asList(), MqttMetricEnum.CLIENT_UNSUBSCRIBE.name());
		public static final ClientMetrics SUBSCRIBE_RELATION = new ClientMetrics("subscribe_relation", Arrays.asList(), Arrays.asList(), MqttMetricEnum.SUBSCRIBE_RELATION.name());
		public static final ClientMetrics BYTES_RECEIVED = new ClientMetrics("bytes_received", Arrays.asList(), Arrays.asList(), MqttMetricEnum.BYTES_RECEIVED.name());
		public static final ClientMetrics BYTES_SENT = new ClientMetrics("bytes_sent", Arrays.asList(), Arrays.asList(), MqttMetricEnum.BYTES_SENT.name());
		public static final ClientMetrics PACKETS_CONNECT_RECEIVED = new ClientMetrics("packets_connect_received", Arrays.asList(), Arrays.asList(), MqttMetricEnum.PACKETS_CONNECT_RECEIVED.name());
		public static final ClientMetrics PACKETS_CONNACK_SENT = new ClientMetrics("packets_connack_sent", Arrays.asList(), Arrays.asList(), MqttMetricEnum.PACKETS_CONNACK_SENT.name());
		public static final ClientMetrics PACKETS_PUBLISH_RECEIVED = new ClientMetrics("packets_publish_received", Arrays.asList(), Arrays.asList(), MqttMetricEnum.PACKETS_PUBLISH_RECEIVED.name());
		public static final ClientMetrics PACKETS_PUBLISH_SENT = new ClientMetrics("packets_publish_sent", Arrays.asList(), Arrays.asList(), MqttMetricEnum.PACKETS_PUBLISH_SENT.name());
		public static final ClientMetrics PACKETS_RECEIVED = new ClientMetrics("packets_received", Arrays.asList(), Arrays.asList(), MqttMetricEnum.PACKETS_RECEIVED.name());
		public static final ClientMetrics PACKETS_SENT = new ClientMetrics("packets_sent", Arrays.asList(), Arrays.asList(), MqttMetricEnum.PACKETS_SENT.name());
		public static final ClientMetrics TOPIC_COUNT = new ClientMetrics("topic_count", Arrays.asList(), Arrays.asList(), MqttMetricEnum.TOPIC_COUNT.name());
		public static final ClientMetrics MESSAGE_QOS0_RECEIVED = new ClientMetrics("messages_qos0_received", Arrays.asList(), Arrays.asList(), MqttMetricEnum.MESSAGE_QOS0_RECEIVED.name());
		public static final ClientMetrics MESSAGE_QOS1_RECEIVED = new ClientMetrics("messages_qos1_received", Arrays.asList(), Arrays.asList(), MqttMetricEnum.MESSAGE_QOS1_RECEIVED.name());
		public static final ClientMetrics MESSAGE_QOS2_RECEIVED = new ClientMetrics("messages_qos2_received", Arrays.asList(), Arrays.asList(), MqttMetricEnum.MESSAGE_QOS2_RECEIVED.name());
		public static final ClientMetrics MESSAGE_QOS0_SENT = new ClientMetrics("messages_qos0_sent", Arrays.asList(), Arrays.asList(), MqttMetricEnum.MESSAGE_QOS0_SENT.name());
		public static final ClientMetrics MESSAGE_QOS1_SENT = new ClientMetrics("messages_qos1_sent", Arrays.asList(), Arrays.asList(), MqttMetricEnum.MESSAGE_QOS1_SENT.name());
		public static final ClientMetrics MESSAGE_QOS2_SENT = new ClientMetrics("messages_qos2_sent", Arrays.asList(), Arrays.asList(), MqttMetricEnum.MESSAGE_QOS2_SENT.name());
		public static final ClientMetrics PERIOD_MESSAGE_RECEIVED = new ClientMetrics("period_message_received", Arrays.asList(), Arrays.asList(), MqttMetricEnum.PERIOD_MESSAGE_RECEIVED.name());
		public static final ClientMetrics PERIOD_MESSAGE_SENT = new ClientMetrics("period_message_sent", Arrays.asList(), Arrays.asList(), MqttMetricEnum.PERIOD_MESSAGE_SENT.name());
		public static final ClientMetrics PACKETS_PUBLISH_RATE = new ClientMetrics("packets_publish_rate", Arrays.asList(), Arrays.asList(), MqttMetricEnum.PACKETS_PUBLISH_RATE.name());


	}

}
